Assembly: C1.LiveLinq (in C1.LiveLinq.dll)
Syntax
C# |
---|
public abstract class Subindex<T, TKey> : Subindex<T> |
Visual Basic |
---|
Public MustInherit Class Subindex(Of T, TKey) _ Inherits Subindex(Of T) |
Type Parameters
- T
- The type of the elements of the collection to index.
- TKey
- The type of the index key.
Remarks
An index (Index<(Of <(<'T, TKey>)>)>) can have subindexes. Subindexes are optional, not required for any indexing tasks, but can provide additional optimization and help minimize memory requirements when a collection is indexed by multi-level (multi-field) keys.
Suppose we want to index a Customers table by two fields, (City, Rating), perhaps for speeding up queries like
from c in Customers where c.City == "London" && c.Rating == 1 select c
from c in Customers where c.City == "London" && c.Rating > 2 select c
Subindexes provide a better alternative for optimizing multi-field searches. In the example above, we can define an index by City
and create a subindex of that index, by Rating. Using subindexes becomes even more effective when, as it is often happens,
we also need queries to search by additional fields, like, for example, if we need to search by ContactTitle inside a city
in addition to the search by Rating inside a city:
from c in Customers where c.City == "London" && c.ContactTitle == "Owner" select c
Inheritance Hierarchy
C1.LiveLinq.Indexing..::..IndexDefinition<(Of <(<'T>)>)>
C1.LiveLinq.Indexing..::..Subindex<(Of <(<'T>)>)>
C1.LiveLinq.Indexing..::..Subindex<(Of <(<'T, TKey>)>)>